package compents;

import lombok.*;

@ToString
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Data
public class RespApi<T> {

    private Integer code;
    private String msg;
    private T data;

    /**
     * 成功
     */
    public static<T> RespApi success(T data){
        return new RespApi(Status.success.getCode(),Status.success.getMsg(),data);
    }

    public static<T> RespApi failed(T data) {
        return new RespApi(Status.failed.getCode(),Status.failed.getMsg(),data);
    }
}
